import { Injectable } from '@angular/core';
import { environment } from 'src/environments/environment';
import { HttpClient } from '@angular/common/http';
@Injectable({
  providedIn: 'root'
})
export class ArticleService {
  public baseUrl:string = environment.myUrl

  constructor(
    private http:HttpClient
  ) { }

  getArticle(){
    return this.http.get(this.baseUrl+'/article/GetAllArticle').toPromise()
  }

  getArticleByClass(c:string,page:number){
    return this.http.get(this.baseUrl+`/article/GetArticleByClass${c}?page=${page}`)
  }

  getLastIdByClass(c:string){
    return this.http.get(this.baseUrl+`/article/GetLastId?c=${c}`).toPromise()
  }
}
